package fileFiltering;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class ImageFilter extends FileFilter{
	@Override
	public boolean accept(File f) {
		if (f.isDirectory()) {
			return true;
		}
		String extension = Utils.getExtension(f);
		if (extension != null) {
			if (extension.equals(Utils.gif) || extension.equals(Utils.png) || extension.equals(Utils.bmp) || extension.equals(Utils.jpeg) || extension.equals(Utils.jpg)) {
				return true;
			} else {
				return false;
			}
		}
		return false;
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return "*.gif, *.png, *.jpeg, *.jpg, *.bmp";
	}
}
